/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author FIRE
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface WecharPriceModelInv extends BasicModel<WecharPriceModelInv> {
  modelCode?: string; // 模板编号
  invCode?: string; // 存货编码
  croute?: string; // 协同路线
  routeDesc?: string; // 协同描述
  routePrice?: string; // 协同单价
}

export const wecharPriceModelInvList = (params?: WecharPriceModelInv | any) =>
  defHttp.get<WecharPriceModelInv>({ url: adminPath + '/setting/pricemodel/wecharPriceModelInv/list', params });

export const wecharPriceModelInvListData = (params?: WecharPriceModelInv | any) =>
  defHttp.post<Page<WecharPriceModelInv>>({ url: adminPath + '/setting/pricemodel/wecharPriceModelInv/listData', params });

export const wecharPriceModelInvForm = (params?: WecharPriceModelInv | any) =>
  defHttp.get<WecharPriceModelInv>({ url: adminPath + '/setting/pricemodel/wecharPriceModelInv/form', params });

export const wecharPriceModelInvSave = (params?: any, data?: WecharPriceModelInv | any) =>
  defHttp.postJson<WecharPriceModelInv>({ url: adminPath + '/setting/pricemodel/wecharPriceModelInv/save', params, data });

export const wecharPriceModelInvImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/setting/pricemodel/wecharPriceModelInv/importData',
      onUploadProgress,
    },
    params,
  );

export const wecharPriceModelInvDelete = (params?: WecharPriceModelInv | any) =>
  defHttp.get<WecharPriceModelInv>({ url: adminPath + '/setting/pricemodel/wecharPriceModelInv/delete', params });

export const wecharPriceModelInvCheck = (params?: WecharPriceModelInv | any) =>
  defHttp.post<WecharPriceModelInv>({ url: adminPath + '/setting/pricemodel/wecharPriceModelInv/check', params });

export const wecharPriceModelInvClear = (params?: WecharPriceModelInv | any) =>
  defHttp.post<WecharPriceModelInv>({ url: adminPath + '/setting/pricemodel/wecharPriceModelInv/clear', params });